<%@ page language="java" contentType="text/html; charset=utf-8"
	pageEncoding="utf-8"%>
<%@taglib prefix="s" uri="/struts-tags"%>
<% 
	String tip = (String)request.getAttribute("tip");
	String email = (String) request.getAttribute("email");
%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
	"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>PaaS平台IDE--忘记密码</title>
<script type="text/javascript" src="/daycodefront/res/js/validate_client.js"></script>
<link href="/daycodefront/res/css/default_layout.css" rel="stylesheet" type="text/css" />
<style type="text/css">
.title{ font-size: 25px; margin:50px auto 20px; width:450px;}
.tip_validate{ font-size:12px; color:red;}
.inputPanel .tiphead{width: 250px; height:30px; margin-left: 110px; font-size: 14px; color: red;}
.inputPanel ul {list-style: none;}
.inputPanel ul li label{display:inline-block; text-align:right; width:100px; margin-left:200px;}
.inputPanel ul li input{width:250px; height: 30px; line-height: 25px;}
.inputPanel ul li .tip {width: 350px; height:30px; margin-left: 310px; font-size: 12px; color: red; text-align:left; }
.inputPanel ul li .validate input{width:80px; height: 30px; line-height: 30px; }
.inputPanel ul li .validate img:hover {cursor: pointer; }
.but_register {padding-left: 110px; margin-left:200px;margin-top:10px;}
.but_register img:hover {cursor: pointer; }
</style>
<script type="text/javascript">
//发送邮件
function sendEmail(){
	var emailFormat = "\\w+([-+.]\\w+)*@\\w+([-.]\\w+)*\\.\\w+([-.]\\w+)*";
	var form = document.forms['forgetpassForm'];
	if(form.email.value==""){
		alert("注册邮箱不能为空！");
	}else if(!form.email.value.match(emailFormat)){
		alert("输入注册邮箱的格式有误！");
	}else if(form.validate.value==""){
		alert("请输入验证码！");
	}else{
		form.submit();
	}
}


//重新获取验证图片
function reloadImage() {
	var verify=document.getElementById('image');
	    verify.setAttribute('src','image.jsp?it='+Math.random());
}
</script>
</head>
<body>
	<div id="header">
		<%@include file="header.jsp"%>
	</div>
	<div id="content_body">
		<div id="content">
			<div class="title">
				<label>忘记密码</label>
			</div>
			<div class="inputPanel">
				<form name="forgetpassForm" action="forgetPass" method="post">
					<div>
						<div class="tiphead">
							<span><%=tip == null ? "" : tip%></span>
						</div>
						<ul>
							<li><label align="right">注册邮箱：</label> 
								<input id="email" type="text" name="email" onfocus="ShowCorrect('email');" onblur="validateForm('email');" /> 
								<span id="tip_email" class="tip_validate"></span>
								<div class="tip"><s:fielderror fieldName="email" id="tip_server_email" /></div>
							</li>
							<li><span class="validate"><label align="right">验证码：</label>
								<input id="validate" type="text" name="validate" onfocus="ShowCorrect('validate'),hideError('validate');"
									onblur="validateForm('validate');" /> &nbsp;&nbsp;&nbsp;
								<img id="image" src="image.jsp" title="看不清楚，换一张" onclick="reloadImage();"/></span>
								<span id="tip_validate" class="tip_validate"></span>
								<div class="tip"><s:fielderror fieldName="tipImage" id="tip_server_validate" /></div>
							</li>
						</ul>
					</div>
					<div class="but_register">
						<img src="/daycodefront/image/but_email.png"
							onmouseover="this.src='/daycodefront/image/but_email1.png'"
							onmouseout="this.src='/daycodefront/image/but_email.png'" 
							alt="发送邮件" onclick="sendEmail()" />
					</div>
				</form>
			</div>
		</div>
	</div>
	<div id="footer">
		<%@include file="footer.jsp"%>
	</div>
</body>
</html>
